﻿<template>
  <div id="content">
    <van-nav-bar
      title="爱尔眼科"
      style="background-color: #36c14c"
      left-text="返回"
      left-arrow
      @click-left="$router.go(-1)"
    >
    </van-nav-bar>
    <div v-for="{ cid, content } in content" :key="cid">
      <div v-html="content"></div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      content: [],
    };
  },
  mounted() {
    console.log(this.$route);
    // 接收兄弟组件传过来的id
    let cid = this.$route.query.cid;
    console.log(cid);
    // 同步 请求  点击标题页 自动读取其id 返回给当前路径 请求对应的详情文章
    this.axios.get(`/activity/aier_activity_content?cid=${cid}`).then(res => {
      console.log("当前详情页" + cid); // 没有数据
      this.content = res.data;
    });
  },
};
</script>

<style lang="scss" scoped>
::v-deep .van-nav-bar__title {
  color: #fff;
}
::v-deep .van-nav-bar__text {
  color: #fff;
}
::v-deep .van-icon {
  color: #fff;
}
</style>
